//
//  UIPickerBankTypeProtocol.m
//  at_xiaoge_client
//
//  Created by Linyu Niu on 27/03/2018.
//  Copyright © 2018 Linyu Niu. All rights reserved.
//

#import "UIPickerBankTypeProtocol.h"

@implementation UIPickerBankTypeProtocol
@synthesize typeList;
@synthesize selectedData;

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{
    return 1;
}



- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{
    return [typeList count];
}
-(CGFloat)pickerView:(UIPickerView *)pickerView rowHeightForComponent:(NSInteger)component{
    return 45;
}


- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(nullable UIView *)view {
    NSDictionary * dic = [typeList objectAtIndex:row];
    
    
    UILabel * label = [[UILabel alloc]init];
    label.text = [dic objectForKey:@"bankName"];
    label.textAlignment = NSTextAlignmentCenter;
    label.font = [UIFont systemFontOfSize:14];
    label.textColor = UIColorFromRGB(0x333333);
    return label;
}

- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
    selectedData = [typeList objectAtIndex:row];
}

-(void)dealloc{
    NSLog(@"%s",__PRETTY_FUNCTION__);
}
@end
